#!/usr/bin/env python3
# -*- coding: utf-8 -*-


class MsgError(Exception):

    def __init__(self, msg):
        self.msg = msg

    def __str__(self):
        return "消息解析错误: {}".format(self.msg)


class MazeError(Exception):

    def __str__(self):
        return "迷宫错误"


class CannotBeWalkedError(MazeError):

    def __init__(self, property_):
        self.property_ = property_

    def __str__(self):
        return "{}({}:{})无法到达".format(self.property_.desc, self.property_.x + 1, self.property_.y + 1)


class WayPointError(MazeError):

    def __init__(self, path):
        self.path = path

    def __str__(self):
        return "路点信息出错: {}".format(self.path)


class PointCoordinateError(MazeError):

    def __init__(self, node):
        self.node = node

    def __str__(self):
        return "节点坐标出错: {}".format(self.node)
